Refund a Klarna payment

For general information about creating payment requests, see createPaymentRequest.

For specific information about requirements for Klarna payments, see Klarna Payments.

Refunds

To process a refund, create a refund request with the following parameters:

Parameter

Description

Type

 
amount The amount to refund, including taxes.    
orderLine Leave blank for goodwill refunds. For all other refunds, the following values are available/required.

Value

Description

Type

Mandatory

description

Description of an item.

String (255)

Yes

itemId

The item identification.

Each itemId must be unique within an order.

String (100)

Yes

quantity

The quantity of the item. The value must be greater than zero.

Decimal

Yes

unitPrice

The unit price, excluding sales tax. The value must be greater than zero, unless the optional goodsType parameter is set to handling, in which case the field will be used to represent a return fee.

Decimal

Yes

taxPercent

This is the tax percentage of the unit price.

Send both the taxPercent and taxAmount parameters in the method call. If you provide only one, the other is inferred, and rounding errors may occur. The taxAmount is used for the calculation, and taxPercent is printed on the invoice.

Decimal

No

taxAmount

This is the total tax on an order line, before any discounts are applied. It is recommended to use taxAmount if possible. If you provide both taxPercent and taxAmount, the amount takes precedence.

Send both the taxPercent and taxAmount parameters in the method call. If you provide only one of the taxPercent and taxAmount parameters, the other parameter is inferred, and rounding errors may occur.
The taxAmount is used for the calculation, and taxPercent is printed on the invoice.

Decimal

Yes

unitCode

The relevant measurement unit for the order line. For example, kg.

String (50)

 

discount

The order line's discount in percent.

Decimal

 

goodsType

The goods type of the order line - shipment| handling| item| digital | discount | gift_card | physical | sales_tax

You can specify a return fee by using order line with goodsType equals handling. This will deduct cost of return from other order lines specified in the refund requests. All order lines amounts minus return fee amount must add up to the total amount of the refund specified in the amount parameter.

Please note that return fee is only supported for Klarna payments that has single capture on full order amount. Otherwise, it will be passed as generic handling cost.

 

Yes

imageUrl

The full URL of the icon for the item

String (255)

 

productUrl The full URL for the description of the item String (255)  
   
reconciliation_identifier

This is the sales reconciliation identifier, used in the reconciliation CSV files you can download from the Merchant Interface, or by using the getCustomReport method. For more information, see getCustomReport.

String{0,100}  

Return with refund fee specified example:

transaction_id                  13
amount	                        4.60
orderLines[0][goodsType]	physical
orderLines[0][description]	test
orderLines[0][quantity]	        1
orderLines[0][taxPercent]	10
orderLines[0][unitPrice]	10
orderLines[0][itemId]	        123981231
orderLines[1][goodsType]	handling
orderLines[1][description]	cost of return
orderLines[1][quantity]	        1
orderLines[1][itemId]	        901209381
orderLines[1][unitPrice]	5.12
orderLines[1][taxPercent]	25
											

This will give you a refund of 4.60, where:

  • The first order line is the item that was purchased. 1 piece, costing 10 + 10% tax = 11.00.
  • The second order line is the return fee. 5.12 + 25% tax = 6.40

Return fee is deducted from rest of the order lines giving the total amount of the refund is 11.00 - 6.40 = 4.60